#ifndef IMPORTDIALOG_H
#define IMPORTDIALOG_H

#include <QDialog>
#include <QLineEdit>
#include <QComboBox>
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QSqlDatabase>

class ImportDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ImportDialog(const QSqlDatabase &db, QWidget *parent = nullptr);
    
    QString getFileName() const;
    QString getTableName() const;
    int getFormat() const;
    bool getFirstRowHeader() const;

private slots:
    void browseFile();
    void validateInput();
    void refreshTables();

private:
    void setupUI();
    void setupConnections();
    
    QLineEdit *m_fileEdit;
    QPushButton *m_browseButton;
    QComboBox *m_formatCombo;
    QComboBox *m_tableCombo;
    QCheckBox *m_firstRowHeaderCheck;
    QDialogButtonBox *m_buttonBox;
    
    QSqlDatabase m_db;
};

#endif // IMPORTDIALOG_H